var dataStatistics = new Vue({
    el:'#dataStatistics',
    data:{
        orderBeginTime:'',
        orderOverTime:'',
        guestBeginTime:'',
        guestOverTime:'',
        orderList:[],
        guestList:[],
        totelneedCollect:'',
        totelTrueCollect:''
    },
    methods:{
        orderSelect:function(){
            $.ajax({
                url:'orderSelect',
                type:'post',
                cache:'false',
                dataType:'json',
                data:{
                    'orderBeginTime':this.orderBeginTime,
                    'orderOverTime':this.orderOverTime
                },
                success :function (data) {
                    if(data.status =='error'){
                        alert(data.info);
                        return;
                    }
                    var orderDtos = data.info;
                    dataStatistics.totelneedCollect = data.totelneedCollect;
                    dataStatistics.totelTrueCollect = data.totelTrueCollect;
                    dataStatistics.orderList = [];
                    for(var i=0;i<orderDtos.length;i++){
                        dataStatistics.orderList.push({
                            id:orderDtos[i].orderId,
                            roomNum:orderDtos[i].roomNum,
                            beginTime:orderDtos[i].beginDay,
                            stayTime:orderDtos[i].stayDay,
                            rantal:orderDtos[i].rantal,
                            truePay:orderDtos[i].truePay
                        });
                    }

                },
                error:function () {
                    alert("请刷新网络");

                }
            })
        },
        guestSelect:function(){
            $.ajax({
                url:'guestSelect',
                type:'post',
                cache:'false',
                dataType:'json',
                data:{
                    'guestBeginTime':this.guestBeginTime,
                    'guestOverTime':this.guestOverTime
                },
                success :function (data) {
                    if(data.status == 'error'){
                        alert(data.info);
                        return;
                    }
                    var guedtDtos = data.info;
                    dataStatistics.guestList = [];
                    for(var i=0;i<guedtDtos.length;i++) {
                        dataStatistics.guestList.push({
                            name: guedtDtos[i].name,
                            identity: guedtDtos[i].identity,
                            tel: guedtDtos[i].tel,
                            times: guedtDtos[i].times,
                            truePay: guedtDtos[i].money
                        })
                    }
                },
                error:function() {
                    alert("请刷新网络");

                }
            })
        }
    }

});